package com.example.olingo.server;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Project:spring-boot-olingo-server
 * <p>
 * Title:ServletConfig.java
 * <p>
 * Description:
 * <p>
 * Copyrigth:Jiang Software LTD.co Copyright (c) 2024
 * <p>
 * 
 * @version 1.0
 * @since 1.8
 * @author jiang
 * @history 2024 jiang create
 */
@Configuration
public class BeanConfig {

	@Autowired
	private CarsServlet carsServlet;

	@Bean
	ServletRegistrationBean<CarsServlet> getServletRegistrationBean() {
		ServletRegistrationBean<CarsServlet> servletRegistrationBean = new ServletRegistrationBean<>();
		servletRegistrationBean.setServlet(carsServlet);
		servletRegistrationBean.addUrlMappings("/cars");
		return servletRegistrationBean;
	}
}